/*****************************************************/
/**				bitmap.c by doom119					 */
/**					June, 2010						 */
/*****************************************************/

#define set_bit(nr, addr) ({\
	register int res asm("ax"); \
	__asm__("cld\n\t" \
			"btsl %2, %3\n\t" \
			"setb %%al\n\t" \
		:"=a"(res) \
		:"0"(0), "r"(nr), "m"(*(addr))); \
	res; \
})

#define clear_bit(nr, addr) ({ \
	register int res asm("ax"); \
	__asm__("cld\n\t" \
			"btrl %2, %3\n\t" \
			"setnb %%al\n\t" \
		:"=a"(res) \
		:"0"(0), "r"(nr), "m"(*(addr))); \
	res; \
})

